package com.rongma.waterdrop.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class TimerChangeReceiver extends BroadcastReceiver {

    public static final String TIMER_RECEIVER_ACTION = "com.rongma.waterdrop.intent.action.TimerChangReceiver";
    private OnTimerChangeListener listener;

    public TimerChangeReceiver()
    {
    }

    public void setListener(OnTimerChangeListener listener)
    {
        this.listener = listener;
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        if(TIMER_RECEIVER_ACTION.equals(intent.getAction()))
        {
            int time = intent.getIntExtra("time",0);
            listener.showTime(time);
        }
    }

    public interface OnTimerChangeListener
    {
        void showTime(int time);
    }


}
